<template>
    <view class="container">
        <rich-text :nodes="formatRichTextFn(datas.Description)"> </rich-text>
    </view>
</template>

<script>
import { InitProductData } from "@/pages/api/product.js"
import { formatRichText } from "@/uni-sub-base/utils/elementUtil.js"
export default {
    components: {},
    data() {
        return {
            datas: {},
            id: "",
            look: 0,
        }
    },
    onLoad(e) {
        this.id = e.id
    },
    mounted() {},
    onShow() {
        this.getinfo()
    },
    methods: {
        getinfo() {
            let path = "?product_id=" + this.id
            InitProductData(path).then((res) => {
                if (res.State == 1) {
                    this.datas = res.Data.ProductModel
                } else {
                    this.easyToast(res.Msg)
                }
            })
        },
        formatRichTextFn(text) {
            return formatRichText(text)
        },
    },
}
</script>

<style lang="scss">
.container {
    padding: 24rpx;
}
.list {
    padding: 24rpx;
    background: #ffffff;
    margin-bottom: 24rpx;
}
.top {
    font-size: 32rpx;
    color: #333;
    padding: 0 16rpx 16rpx 16rpx;
}
.number {
    font-size: 26rpx;
    color: #999;
}
.top_left {
    display: flex;
    flex-direction: column;

    view {
        padding: 7rpx 0;
    }
}
.body {
    background: #f4f5f6;
    padding: 24rpx;
    margin-bottom: 16rpx;
    & > view {
        display: flex;
        flex-direction: column;
        font-size: 26rpx;
        color: #333333;
    }
    input {
        width: 292rpx;
        height: 68rpx;
        background: #ffffff;
        border-radius: 4rpx;
        font-size: 32rpx;
        text-indent: 20rpx;
        color: $app-color-main;
        font-weight: bold;
    }
    .title {
        padding-bottom: 16rpx;
    }
}
.placeColor {
    font-size: 28rpx;
    color: $color-gray-3;
    font-weight: normal;
}
.btn {
    margin: 16rpx 30rpx 0 30rpx;
}

.top_right {
    input {
        width: 216rpx;
        height: 72rpx;
        background: #f4f5f6;
        border-radius: 36rpx;
        font-size: 32rpx;
        font-weight: bold;
        color: #222a42;
        text-align: center;
    }
}
</style>
